package br.com.basili.mb;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.basili.dao.ResearcherDAO;
import br.com.basili.entity.Researcher;
import br.com.basili.utility.UrlsBASILI;

@ManagedBean
@RequestScoped
public class ResearcherMB {

	private Researcher researcher;
	private ResearcherDAO researcherDAO = new ResearcherDAO();
	
	public ResearcherMB() {
		researcher = new Researcher();
	}

	public Researcher getResearcher() {
		return researcher;
	}

	public void setResearcher(Researcher researcher) {
		this.researcher = researcher;
	}
	
	public String salvar() throws Exception{
		researcherDAO.salvar(researcher);
		researcher = new Researcher();
		return UrlsBASILI.PAGE_RESEARCHER_REGISTER;
	}
	
}
